<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Rails::Generator::Spec</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Rails::Generator::Spec</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/vendor/rails/railties/lib/rails_generator/spec_rb.html">
                vendor/rails/railties/lib/rails_generator/spec.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="../../Object.html">
                Object
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
A spec knows where a generator was found and how to instantiate it.
Metadata include the generator&#8216;s name, its base path, and the source
which yielded it (<a href="PathSource.html">PathSource</a>, <a
href="GemPathSource.html">GemPathSource</a>, etc.)
</p>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M001896">class_file</a>&nbsp;&nbsp;
      <a href="#M001897">class_name</a>&nbsp;&nbsp;
      <a href="#M001895">klass</a>&nbsp;&nbsp;
      <a href="#M001894">new</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">name</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">path</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">source</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M001894" class="method-detail">
        <a name="M001894"></a>

        <div class="method-heading">
          <a href="#M001894" class="method-signature">
          <span class="method-name">new</span><span class="method-args">(name, path, source)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001894-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001894-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/railties/lib/rails_generator/spec.rb, line 9</span>
 9:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">source</span>)
10:         <span class="ruby-ivar">@name</span>, <span class="ruby-ivar">@path</span>, <span class="ruby-ivar">@source</span> = <span class="ruby-identifier">name</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">source</span>
11:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M001896" class="method-detail">
        <a name="M001896"></a>

        <div class="method-heading">
          <a href="#M001896" class="method-signature">
          <span class="method-name">class_file</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001896-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001896-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/railties/lib/rails_generator/spec.rb, line 24</span>
24:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">class_file</span>
25:         <span class="ruby-node">&quot;#{path}/#{name}_generator.rb&quot;</span>
26:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001897" class="method-detail">
        <a name="M001897"></a>

        <div class="method-heading">
          <a href="#M001897" class="method-signature">
          <span class="method-name">class_name</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001897-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001897-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/railties/lib/rails_generator/spec.rb, line 28</span>
28:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">class_name</span>
29:         <span class="ruby-node">&quot;#{name.camelize}Generator&quot;</span>
30:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001895" class="method-detail">
        <a name="M001895"></a>

        <div class="method-heading">
          <a href="#M001895" class="method-signature">
          <span class="method-name">klass</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Look up the generator class. Require its class file, find the class in
ObjectSpace, tag it with this spec, and return.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001895-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001895-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/railties/lib/rails_generator/spec.rb, line 15</span>
15:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">klass</span>
16:         <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@klass</span>
17:           <span class="ruby-identifier">require</span> <span class="ruby-identifier">class_file</span>
18:           <span class="ruby-ivar">@klass</span> = <span class="ruby-identifier">lookup_class</span>
19:           <span class="ruby-ivar">@klass</span>.<span class="ruby-identifier">spec</span> = <span class="ruby-keyword kw">self</span>
20:         <span class="ruby-keyword kw">end</span>
21:         <span class="ruby-ivar">@klass</span>
22:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>